using Xtensive.Orm;

namespace SalesPoint.Model
{
  [TableMapping("Suppliers")]
  [HierarchyRoot]
  public class Supplier : BusinessContact
  {
    [Field, FieldMapping("SupplierId"), Key]
    public int Id { get; private set; }

    [Field]
    public string HomePage { get; set; }

    [Field]
    [Association(PairTo = "Supplier", OnOwnerRemove = OnRemoveAction.Clear, OnTargetRemove = OnRemoveAction.Clear)]
    public EntitySet<Product> Products { get; private set; }

    public Supplier(Session session, int id)
      : base(session, id)
    {
    }
  }
}